package db.pojo;

import java.util.*;
import java.text.SimpleDateFormat;
import db.ext.EaroleExt;
@SuppressWarnings("unchecked")
/**
 * earole
 */
public class Earole {
	/**
	 * ROLEID
	 */
	public String rOLEID;
	/**
	 * ROLENAME
	 */
	public String rOLENAME;
	/**
	 * DEPTID
	 */
	public String dEPTID;
	/**
	 * ROLETYPE
	 */
	public String rOLETYPE;
	/**
	 * REMARK
	 */
	public String rEMARK;
	/**
	 * LOCKED
	 */
	public String lOCKED;
	SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	public static EaroleExt DB = new EaroleExt(); 
	
	public Earole() {
		super();
	}
	
	public Earole(String rOLEID, String rOLENAME, String dEPTID, String rOLETYPE, String rEMARK, String lOCKED) {
		super();
		this.rOLEID = rOLEID; 
		this.rOLENAME = rOLENAME; 
		this.dEPTID = dEPTID; 
		this.rOLETYPE = rOLETYPE; 
		this.rEMARK = rEMARK; 
		this.lOCKED = lOCKED; 
	}
	
	public String getROLEID() {
		return rOLEID;
	}

	public void setROLEID(String rOLEID) {
		this.rOLEID = rOLEID;
	} 
	
	public String getROLENAME() {
		return rOLENAME;
	}

	public void setROLENAME(String rOLENAME) {
		this.rOLENAME = rOLENAME;
	} 
	
	public String getDEPTID() {
		return dEPTID;
	}

	public void setDEPTID(String dEPTID) {
		this.dEPTID = dEPTID;
	} 
	
	public String getROLETYPE() {
		return rOLETYPE;
	}

	public void setROLETYPE(String rOLETYPE) {
		this.rOLETYPE = rOLETYPE;
	} 
	
	public String getREMARK() {
		return rEMARK;
	}

	public void setREMARK(String rEMARK) {
		this.rEMARK = rEMARK;
	} 
	
	public String getLOCKED() {
		return lOCKED;
	}

	public void setLOCKED(String lOCKED) {
		this.lOCKED = lOCKED;
	} 
	
	
	public Map earoleToMap() {
		Map map = new HashMap();
		try {
			map.put("rOLEID",this.rOLEID);
			map.put("rOLENAME",this.rOLENAME);
			map.put("dEPTID",this.dEPTID);
			map.put("rOLETYPE",this.rOLETYPE);
			map.put("rEMARK",this.rEMARK);
			map.put("lOCKED",this.lOCKED);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return map;
	}

	public Earole mapToEarole(Map map){
		try {
			String rOLEID =  map.get("rOLEID").toString();
			String rOLENAME =  map.get("rOLENAME").toString();
			String dEPTID =  map.get("dEPTID").toString();
			String rOLETYPE =  map.get("rOLETYPE").toString();
			String rEMARK =  map.get("rEMARK").toString();
			String lOCKED =  map.get("lOCKED").toString();
			Earole earole = new Earole(rOLEID, rOLENAME, dEPTID, rOLETYPE, rEMARK, lOCKED);
			return earole;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	} 
	
	public String toString(){
		return earoleToMap().toString();
	}
	
	//方便数据操作	
	public Earole insert(){
		return DB.insert(this);
	}
	public Earole update(){
		return DB.update(this);
	}
	
	public int delete(){
		return DB.delete(this);
	}
	
}
